package cn.roadtrip.utilmodule.util.enumpck;

/**
 * 游客创建得行程订状态
 */
public enum Enum_MainTourTravelLineStats {
    WaitOwner("WaitOwner", "待创建人开启"),
    Freze("Freze", "不可报名"),
    Trash("Trash", "删除"),
    Wait("Wait", "待报名"),
    ApplyOk("ApplyOk", "报名完成"),
    Cancel("Cancel", "取消"),
    Start("Start", "行程开始"),
    TravelOver("TravelOver", "行程结束"),
    AlreadyFull("AlreadyFull","满团"),
    ;

    private String s;
    private String title;

    Enum_MainTourTravelLineStats(String s, String title) {
        this.s = s;
        this.title = title;
    }

    Enum_MainTourTravelLineStats(String s) {
        this.s = s;
        this.title = Enum_HotelRoomType.parseCode(s).getTitle();
    }

    public String getTitle() {
        return this.title;
    }

    public String getCode() {
        return this.s;
    }

    public static final Enum_MainTourTravelLineStats parseCode(String code) {
        switch (code) {
            case "Freze":
                return Freze;
            case "WaitOwner":
                return WaitOwner;
            case "Trash":
                return Trash;
            case "Wait":
                return Wait;
            case "ApplyOk":
                return ApplyOk;
            case "Cancel":
                return Cancel;
            case "Start":
                return Start;
            case "TravelOver":
                return TravelOver;
            case "AlreadyFull":
                return AlreadyFull;
        }
        return null;
    }

    @Override
    public String toString() {
        return "(code:%s, title:%s)".formatted(this.s, this.title);
    }
}
